import { pageTo } from 'nc-lightapp-front';
function sscOpenTo(props, outSystem, openToParams, defaultOpenFn) {
    if (outSystem) {
        switch(outSystem) {
            case 'YBZ' :
                pageTo.specialOpenToOut(...openToParams)
                break;
        }
    } else {
        if(openToParams&&openToParams[3]){
            pageTo.addParentUrlParam(
                JSON.stringify({
                    pk_group:openToParams[3].pk_group
                })
            )
        }
        defaultOpenFn ?  defaultOpenFn(...openToParams) : props.specialOpenTo(...openToParams);
        if(openToParams&&openToParams[3]){
            pageTo.deleteParentUrlParam();
        }
    }
}

export default sscOpenTo;